<template>
  <AppPage class="bg-[#f5f6fa] h-screen" article-class="" header-class="bg-[#3d8ffd]">
    <template #center>
      <span class="c-white">签证结果</span>
    </template>

    <div class="pb-70">
      <div class="px-15 pt-15 mb-12 cell_container">
        <div class="bg-white rounded-6 py-10 mb-12">
          <div class="flex justify-between px-12 items-center py-5">
            <div class="w-70 c-[#999] text-14  white-space">签证结果</div>
            <div class=" c-[#999] flex flex-1 items-center justify-between">
              <span class="c-[#333] text-14 w-100 text-ellipsis--l1">{{ resultVisa(route.query.applicant_status) }}</span>
            </div>
          </div>
        </div>
        <div class="bg-white rounded-6 py-10">
          <div class="flex justify-between px-12 items-center py-5">
            <div class="w-70 c-[#999] text-14  white-space">签证文件</div>
            <nut-button @click="downLoad" size="small" type="primary" color="#3d8ffd" plain>下载签证文件</nut-button>
          </div>
        </div>
      </div>
    </div>
  </AppPage>
</template>
<script setup>
import { onMounted, ref } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { useVisaStore } from '@/store/modules/visa/index.js'
import { showToast } from '@nutui/nutui';

let needList = ref([])
const route = useRoute()
const router = useRouter()

onMounted(async () => {

})
const resultVisa = (status) => {
  // [5, 6, 14, 15, 16]
  if (status === 5) {
    return '出签成功'
  } else {
    return '拒签'
  }
}
const toClick = () => {
  downLoad(route.query.visa_result_url)
}
const downLoad = () => {
  var active = document.createElement('a')
  active.href = route.query.visa_result_url
  document.body.appendChild(active)
  active.click()
  showToast.text('正在下载,请前往下载内容查看');
}

</script>
<style scoped>
.card-tabs .n-tabs-nav--bar-type {
  padding-left: 4px;
}
</style>
<style lang="scss" scoped>
.city {
  line-height: 32px;
  border: 1px solid #ddd;
}
.city.active {
  line-height: 32px;
  border: 1px solid #f00;
}
</style>